/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package escr.persistencia;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Aditardo
 */
@Entity
@Table(name = "paciente")
@NamedQueries({@NamedQuery(name = "Paciente.findByPacCodigo", query = "SELECT p FROM Paciente p WHERE p.pacCodigo = :pacCodigo"), @NamedQuery(name = "Paciente.findByPacCedula", query = "SELECT p FROM Paciente p WHERE p.pacCedula = :pacCedula"), @NamedQuery(name = "Paciente.findByPacApellid", query = "SELECT p FROM Paciente p WHERE p.pacApellid = :pacApellid"), @NamedQuery(name = "Paciente.findByPacNombre", query = "SELECT p FROM Paciente p WHERE p.pacNombre = :pacNombre"), @NamedQuery(name = "Paciente.findByPacFechanaci", query = "SELECT p FROM Paciente p WHERE p.pacFechanaci = :pacFechanaci"), @NamedQuery(name = "Paciente.findByPacDireccion", query = "SELECT p FROM Paciente p WHERE p.pacDireccion = :pacDireccion"), @NamedQuery(name = "Paciente.findByPacFono", query = "SELECT p FROM Paciente p WHERE p.pacFono = :pacFono"), @NamedQuery(name = "Paciente.findByPacCelular", query = "SELECT p FROM Paciente p WHERE p.pacCelular = :pacCelular"), @NamedQuery(name = "Paciente.findByPacOcupac", query = "SELECT p FROM Paciente p WHERE p.pacOcupac = :pacOcupac"), @NamedQuery(name = "Paciente.findByPacSexo", query = "SELECT p FROM Paciente p WHERE p.pacSexo = :pacSexo"), @NamedQuery(name = "Paciente.findByPacTipo", query = "SELECT p FROM Paciente p WHERE p.pacTipo = :pacTipo"), @NamedQuery(name = "Paciente.findByPacNomurgen", query = "SELECT p FROM Paciente p WHERE p.pacNomurgen = :pacNomurgen"), @NamedQuery(name = "Paciente.findByPacFonourg", query = "SELECT p FROM Paciente p WHERE p.pacFonourg = :pacFonourg"), @NamedQuery(name = "Paciente.findByPacFechains", query = "SELECT p FROM Paciente p WHERE p.pacFechains = :pacFechains"), @NamedQuery(name = "Paciente.findByPacEstado", query = "SELECT p FROM Paciente p WHERE p.pacEstado = :pacEstado")})
public class Paciente implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "PAC_CODIGO", nullable = false)
    private Integer pacCodigo;
    @Column(name = "PAC_CEDULA")
    private String pacCedula;
    @Column(name = "PAC_APELLID")
    private String pacApellid;
    @Column(name = "PAC_NOMBRE")
    private String pacNombre;
    @Column(name = "PAC_FECHANACI")
    @Temporal(TemporalType.DATE)
    private Date pacFechanaci;
    @Column(name = "PAC_DIRECCION")
    private String pacDireccion;
    @Column(name = "PAC_FONO")
    private String pacFono;
    @Column(name = "PAC_CELULAR")
    private String pacCelular;
    @Column(name = "PAC_OCUPAC")
    private String pacOcupac;
    @Column(name = "PAC_SEXO")
    private String pacSexo;
    @Column(name = "PAC_TIPO")
    private String pacTipo;
    @Column(name = "PAC_NOMURGEN")
    private String pacNomurgen;
    @Column(name = "PAC_FONOURG")
    private String pacFonourg;
    @Column(name = "PAC_FECHAINS")
    @Temporal(TemporalType.DATE)
    private Date pacFechains;
    @Column(name = "PAC_ESTADO")
    private Integer pacEstado;
    @OneToMany(mappedBy = "pacCodigo")
    private Collection<Usuturno> usuturnoCollection;
    @OneToMany(mappedBy = "pacCodigo")
    private Collection<Turno> turnoCollection;

    public Paciente() {
    }

    public Paciente(Integer pacCodigo) {
        this.pacCodigo = pacCodigo;
    }

    public Integer getPacCodigo() {
        return pacCodigo;
    }

    public void setPacCodigo(Integer pacCodigo) {
        this.pacCodigo = pacCodigo;
    }

    public String getPacCedula() {
        return pacCedula;
    }

    public void setPacCedula(String pacCedula) {
        this.pacCedula = pacCedula;
    }

    public String getPacApellid() {
        return pacApellid;
    }

    public void setPacApellid(String pacApellid) {
        this.pacApellid = pacApellid;
    }

    public String getPacNombre() {
        return pacNombre;
    }

    public void setPacNombre(String pacNombre) {
        this.pacNombre = pacNombre;
    }

    public Date getPacFechanaci() {
        return pacFechanaci;
    }

    public void setPacFechanaci(Date pacFechanaci) {
        this.pacFechanaci = pacFechanaci;
    }

    public String getPacDireccion() {
        return pacDireccion;
    }

    public void setPacDireccion(String pacDireccion) {
        this.pacDireccion = pacDireccion;
    }

    public String getPacFono() {
        return pacFono;
    }

    public void setPacFono(String pacFono) {
        this.pacFono = pacFono;
    }

    public String getPacCelular() {
        return pacCelular;
    }

    public void setPacCelular(String pacCelular) {
        this.pacCelular = pacCelular;
    }

    public String getPacOcupac() {
        return pacOcupac;
    }

    public void setPacOcupac(String pacOcupac) {
        this.pacOcupac = pacOcupac;
    }

    public String getPacSexo() {
        return pacSexo;
    }

    public void setPacSexo(String pacSexo) {
        this.pacSexo = pacSexo;
    }

    public String getPacTipo() {
        return pacTipo;
    }

    public void setPacTipo(String pacTipo) {
        this.pacTipo = pacTipo;
    }

    public String getPacNomurgen() {
        return pacNomurgen;
    }

    public void setPacNomurgen(String pacNomurgen) {
        this.pacNomurgen = pacNomurgen;
    }

    public String getPacFonourg() {
        return pacFonourg;
    }

    public void setPacFonourg(String pacFonourg) {
        this.pacFonourg = pacFonourg;
    }

    public Date getPacFechains() {
        return pacFechains;
    }

    public void setPacFechains(Date pacFechains) {
        this.pacFechains = pacFechains;
    }

    public Integer getPacEstado() {
        return pacEstado;
    }

    public void setPacEstado(Integer pacEstado) {
        this.pacEstado = pacEstado;
    }

    public Collection<Usuturno> getUsuturnoCollection() {
        return usuturnoCollection;
    }

    public void setUsuturnoCollection(Collection<Usuturno> usuturnoCollection) {
        this.usuturnoCollection = usuturnoCollection;
    }

    public Collection<Turno> getTurnoCollection() {
        return turnoCollection;
    }

    public void setTurnoCollection(Collection<Turno> turnoCollection) {
        this.turnoCollection = turnoCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pacCodigo != null ? pacCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Paciente)) {
            return false;
        }
        Paciente other = (Paciente) object;
        if ((this.pacCodigo == null && other.pacCodigo != null) || (this.pacCodigo != null && !this.pacCodigo.equals(other.pacCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "escr.persistencia.Paciente[pacCodigo=" + pacCodigo + "]";
    }

}
